package com.dci.config.db;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import javax.sql.DataSource;

/**
 * All rights Reserved, Designed By 姑苏区政府大数据中心
 *
 * @version V1.0
 * @Package com.acp.dao
 * @Description: 数据源配置
 * @author: gis-许高峰
 * @date: 2019/3/22 17:48
 * @Copyright: 姑苏区政府大数据中心
 */
@Configuration
public class DataSourceConfig {

    /**
     * 查询
     *
     * @return
     */
    @Bean(name = "acpDmsDataSource")
    @Primary
    @ConfigurationProperties(prefix = "spring.datasource.dcipms")
    public DataSource acpTempDataSource() {
        return DataSourceBuilder.create().build();
    }

    /**
     * 查询
     *
     * @return
     */
    @Bean(name = "acpMsDataSource")
    @ConfigurationProperties(prefix = "spring.datasource.dcims")
    public DataSource acpMsDataSource() {
        return DataSourceBuilder.create().build();
    }

}
